home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / tshare.arc / NEW14H.DOC < prev    next >
Text File  |  1985-10-25  |  13KB  |  321 lines

  1.                 /==========\
  2.                 |  NEW14H  |                (2.7)
  3.                 \==========/
  4.  
  5.             Marty Ross
  6.             c/o Computing Resource Center
  7.             10801 National Blvd.,  Third Floor
  8.             Los Angeles, CA  90064
  9.  
  10. Release:    2.7, 10/18/85
  11. By:            Marty Ross, at the Computing Resource Center
  12. System:     IBM-PC with standard communications adapter (COM1: or COM2:)
  13. Requirements:    Tested using PC-DOS 2.0/2.1/3.1, 128K or larger PC preferred.
  14.  
  15. Abstract:    NEW14H is a DOS-extension (resident program) which intercepts
  16.         calls made to the BIOS communication application interrupt
  17.         (INT 14H), and adds extended functions to the communication
  18.         repertoire.  The program maintains a 32K input buffer, and
  19.         a 255 byte output buffer, and uses both input and output
  20.         hardware interrupts for maximum efficiency.
  21.  
  22.         If none of this makes any sense, then you don't need NEW14H
  23.         unless you are using application software which requires it,
  24.         sich as TSHARE, the background terminal emulator driver.
  25.  
  26.         NEW14H is of primary interest to communication software 
  27.         developers only.
  28.  
  29. Distribution:    I am distributing this preliminery version freely, in hopes to
  30.         stimulate interest and feedback.  No fee may be charged for its
  31.         distribution, and this document must accompany the programs
  32.         documented herein. 
  33.  
  34. Features:    NEW14H provides a more accurate way to read characters from
  35.         the communication port.  The application program need not
  36.         keep up on a character basis with the incoming data: a 32K
  37.         circular input buffer is used and always updated while any
  38.         normal PC software executes.  If NEW14H is installed on two
  39.         ports, then each port has 32K input buffer so is independant
  40.         from the other device.  See extended function calls in .ASM
  41.         excerpt for details on extended functions provided by NEW14H.
  42.  
  43. Usage:        There are three steps necessary to activate NEW14H so that
  44.         it may be used to by application software:
  45.  
  46.             1.)  Initialize DOS
  47.             2.)  Install the NEW14H communication enhancements
  48.             4.)  Initialize the COM: port for desired baud/parity
  49.                  (NEW14H DOES NOT DO THIS: USE PC-DOS "MODE.COM")
  50.  
  51.         A typical installation sequence (which can be combined into
  52.         a .BAT file, such as "AUTOEXEC.BAT"):
  53.  
  54.  
  55.         +---------------------------------------------------------+
  56.         |                              |
  57.        (1)    |    <ALT>+<CTL>+<DEL> ...                  |
  58.         |                              |
  59.         |    IBM Disk Operating System              |
  60.         |    Version x.xx ...                  |
  61.         |                              |
  62.        (2)    |    A>new14h                      |
  63.         |    NEW14H - 2.x - (C) Copyright 1985, by Marty Ross  |
  64.         |    Auxiliary COM1: port driver active.          |
  65.         |                              |
  66.        (3)    |    A>mode com1:300,n,8                  |
  67.         |      COM1:300,n,8,-                  |
  68.         |                              |
  69.         |    A>_                          |
  70.         |                              |
  71.         +---------------------------------------------------------+
  72.  
  73. Why NEW14H?:    NEW14H was written because the BIOS counterpart is severely
  74.         deficient, and does not even use the powerful interrupt cap-
  75.         abilities on the communication devices used in the IBM-PC.
  76.         NEW14H intercepts the common call made to the BIOS services
  77.         for async communication, and although not tested for transp-
  78.         arency, was modeled after the old INT 14H so that existing
  79.         application software can take advantage of the enhancements
  80.         provided without modification.  Additional calls provided by
  81.         NEW14H also add a degree of power to the INT 14H system inter-
  82.         rupt which software developers can use for convenience, and
  83.         power which previously was possible only by taking care of
  84.         all the details of communication themselves, detracting from
  85.         their overall purpose.
  86.  
  87. Disclaimer:    Though I've tested NEW14H under varying conditions, I cannot
  88.         guarantee that it will work in every case/PC configuration.
  89.         Also, I suggest you use caution when using NEW14H in new
  90.         situations (on two ports, etc): I will not be liable for any
  91.         damage caused by NEW14H, but would like to be informed if any
  92.         undesireable interactions occur.  Please write me.
  93.  
  94. On-line help:    For on-line info, type "NEW14H ?" which will cause the following 
  95.         display:
  96.  
  97.    +----------------------------------------------------------------------+
  98.    |    syntax:                                      |
  99.    |            new14h [port#]                          |
  100.    |    port#:                                      |
  101.    |            1 - COM1:                          |
  102.    |            2 - COM2:                          |
  103.    |                                          |
  104.    |       You can use the PC-DOS "MODE" command to initialize              |
  105.    |    or change the channel baud rate, and parity settings              |
  106.    |    (e.g. "MODE COM1:300,E,7").                          |
  107.    |                                          |
  108.    |       The communication channel will occupy approximately              |
  109.    |    33K of memory, and will remain active until CTL-ALT-DEL.          |
  110.    |                                          |
  111.    +----------------------------------------------------------------------+    
  112.  
  113.     which indicates that you may install NEW14H on either the COM1: or
  114.     the COM2: port by specifying the port number.  
  115.  
  116.     NOTE: As indicated above, NEW14H does not automatically initialize
  117.           the selected communication port for baud rate or parity set-
  118.           tings.  Use the DOS 'MODE' command for this purpose BEFORE
  119.           attempting to use the port for communication.
  120.  
  121.  
  122.  
  123. About the Author:
  124.  
  125.         Marty Ross is a consultant for the Computing Resource Center,
  126.         a data processing firm in Los Angeles.  CRC uses the IBM VM/SP
  127.         operating system to provide its clients with an interactive
  128.         method to access popular mainframe data handling facilities, 
  129.         such as SAS, PL/1, FORTRAN, and the On-Line Data System, 
  130.         CRC's own database management product.  For microcomputers,
  131.         CRC has released a Statistics/Data Analysis and Graphics
  132.         package for the IBM-PC called STATA, the Data Tool, which 
  133.         features standard statistical (regression) analyses, excellent 
  134.         data handling capabilities, and a wide variety of experimental
  135.         data analysis techniques with STATA/Graphics.  If you are 
  136.         interested in obtaining a DEMO copy of STATA, please call CRC
  137.         on their toll-free number:  1-800-782-8272 outside California,
  138.         or dial them directly at (213) 470-4341.  Be sure to tell them
  139.         that Marty sent you!
  140.  
  141.  
  142.  
  143. Technical specs:  (excerpt from source program):
  144. ----------------
  145.  
  146.         TITLE    NEW14H - Enhanced communications driver for COM adapter
  147.         SUBTTL    Copyright (C) 1985 by Marty Ross
  148.         PAGE    66,132
  149.  
  150. ; last mod 10/21/85 - new function x'90': "enable_ints"
  151. ;
  152. ; NEW14H - Replacement driver for PC BIOS INT 14 call.
  153. ;
  154. ;    Defines interrupt driver COMmunication "channel," and intercepts 
  155. ;    INT 14H for UART INIT, character READ/WRITE, and other added functions.
  156. ;
  157. ;    NOTE: This version supports only one buffer configuration:
  158. ;        
  159. ;        256 byte OUTPUT buffer
  160. ;        32K byte INPUT buffer
  161. ;
  162. ;    Both lists are treated as circular character lists, and an error 
  163. ;    return is indicated for output overflow by the TIMEOUT BIT, and 
  164. ;    and the value EOF in AL.  Application must process incoming data
  165. ;    fast enough so as not to allow more than 32K (size of input buffer)
  166. ;    of data to remain un-processed (READ via RECV_CODE function call).
  167. ;
  168. ;   functions intercepted (replaced):
  169. ;    
  170. ;    code(AH)    function        added feature(s)
  171. ;    
  172. ;    0        INITIALIZE UART        Re-enables interrupt system
  173. ;    1        SEND CHARACTER        Interrupt driven, buffered.
  174. ;    2        RECEIVE CHARACTER    Interrupt driven, buffered.
  175. ;                        NOTE: will HANG for TIMEOUTCNT
  176. ;    3        RETURN MSR & LSR
  177. ;
  178. ;   as with old NEW14H, B7 of AH returned is timeout bit (as per TIMEOUTCNT),
  179. ;   and AH will always return with value of line status (bits 0-6).
  180. ;
  181. ;   added functions:
  182. ;
  183. ;    80h        RETURN VERSION NUMBER OF THIS DRIVER IN AH, AL.
  184. ;            MAJOR VERSION # WILL NOT EXCEED 9, SO IF AH RETURNS
  185. ;            WITH VALUE > 9, THIS PROGRAM IS NOT INSTALLED AND 
  186. ;            'ADDED' SUB-FUNCTIONS (BELOW) SHOULD NOT BE USED.
  187. ;    84h        RETURN SIZE OF COMMUNICATION BUFFER
  188. ;    85h        FLUSH COMMUNICATION BUFFER
  189. ;    86h        CHECK FOR ANY CHARACTERS IN BUFFER/RETURN Z IF NONE
  190. ;            IF CHAR(S) EXIST, FIRST CHAR RETURNED IN AL
  191. ;    87h        SEND BREAK SIGNAL OVER SELECTED PORT
  192. ;    88h        RETURN 0 in AX if no chars in buffer, else non zero
  193. ;    89h        Re-ENABLE interrupts (after initializing baud rate)
  194. ;            (since we don't intercept SET BAUD RATE function,
  195. ;            must use BIOS' which disables our interrupts!).
  196. ;    8AH        This call allows caller to predict whether I/O is
  197. ;            currently taking place (at the device level).  If
  198. ;            char(s) received since last call, AL will be NZ.
  199. ;    8BH        This call sets or resets an ALARM feature which causes
  200. ;            the IBM-PC (BIOS) BELL to ring when a control-G ASCII
  201. ;            character is read from the communication line.
  202. ;            (AL=0 means TURN ALARM OFF, AL!=0 means TURN ALARM ON)
  203. ;    8CH        Pass non zero value back in AL if exist characters in
  204. ;            the output queue.
  205. ;    8DH        Read the value at the UART port offset from base port
  206. ;            (offset given in AL, i.e. - COM1: base=3F8), value is
  207. ;            returned in DL.
  208. ;    8EH        Write the UART port (offset from base port given in AL),
  209. ;            value to be written is passed in DL.
  210. ;    8FH        Set or reset XON/XOFF protocol.  
  211. ;            AL=0 Means RESET, non zero AX means SET
  212. ;    90H        Force enabling the interrupts, similar to 89H but not
  213. ;            as extensive; only does OUT ier,INT_TYPS
  214. ;
  215. ;   DX must contain PORT # (0,1 valid).
  216. ;   I.E. 0=COM1, 1=COM2, etc.
  217.  
  218.  
  219.  
  220. ----------------------------
  221.  
  222. [1]  NEW14H will be destroyed by programs such as BASIC or BASICA which 
  223.      re-define the communication interrupt driver(s).
  224.  
  225. ------------------------------------------------------------------------------
  226.  
  227.                 /==========\        
  228.                 |  NEW14H  |                (2.7)
  229.                 \==========/
  230.  
  231.             Marty Ross
  232.             c/o Computing Resource Center
  233.             10801 National Blvd., Third Floor
  234.             Los Angeles, CA  90064
  235.  
  236.             Release:    2.7, 10/18/85
  237.  
  238.                 Comments?   
  239.                 Can you use NEW14H?  
  240.  
  241.  
  242. Name:       _________________________________________________________
  243.  
  244.  
  245. Address:    _________________________________________________________
  246.  
  247.             _________________________________________________________
  248.  
  249.             _________________________________________________________
  250.  
  251.  
  252.         ---------------------------------------------------------
  253.         
  254.  
  255. Comments:   _________________________________________________________
  256.  
  257.             _________________________________________________________
  258.  
  259.             _________________________________________________________
  260.  
  261.             _________________________________________________________
  262.  
  263.             _________________________________________________________
  264.  
  265.             _________________________________________________________
  266.  
  267.             _________________________________________________________
  268.  
  269.             _________________________________________________________
  270.  
  271.             _________________________________________________________
  272.  
  273.             _________________________________________________________
  274.  
  275.             _________________________________________________________
  276.  
  277.  
  278.     If you feel NEW14H contributes to your effectiveness, then please let
  279.     me know by sending a donation of $10.00 or whatever you feel is ap-
  280.     propriate.  NEW14H was developed in my spare time, and is now not a
  281.     commercial effort of CRC.  I will continue to develop products like
  282.     NEW14H for those who show interest - provided I can afford it.  Users
  283.     who make contributions will be entitled to a single sided diskette
  284.     of other PC-DOS utilities I've developed while at CRC: please include 
  285.     your name and return address when sending donations!
  286.  
  287.     P.S. -  If it's the $10.00 that's keeping your from filling out & 
  288.         sending this sheet, forget about the money!  I'd like to 
  289.         hear your comments!
  290.  (0,1 valid).
  291. ;   I.E. 0=COM1, 1=COM2, etc.
  292. ;
  293. ;   Start of program; definitions:
  294. ;
  295. ;   First set; potentially user-modifyable definitions:
  296. ;
  297. main_version    equ    2    ; version number - do NOT exceed 9 !!
  298. sub_version    equ    7    ; release number - "  "   "      " !!!
  299. intcom1_name    equ    1    ; our name (if we are COM1) is 1
  300. intcom2_name    equ    2    ; our name (if we are COM2) is 2
  301. EOF        equ    0FFh    ; EOF return value; may wish to use ESC, (1AH)
  302. buffer_size    equ    32767    ; Size (chars) of input buffer
  303. xbuffer_size    equ    256    ; Size (chars) of output buffer
  304. read_id        equ    80h    ; 'added' INT14H calls - IDentify self call.
  305. length_code    equ    84h    ; 'added' call - get buffer length
  306. flush_code    equ    85h    ; added flush buffer call.
  307. chkbuf_code    equ    86h    ; added check buffer call
  308. break_code    equ    87h    ; added send break signal over line call
  309. bf_hit        equ    88h    ; added 'chars in buffer' ? call
  310. reset_ints    equ    89h    ; added 'reset interrupts' call
  311. c_activity    equ    8Ah    ; added 'active since last call?' call
  312. alarm_code    equ    8Bh    ; added 'set alarm' call
  313. oq_empty    equ    8Ch    ; added 'output queue empty ?' call
  314. read_port    equ    8Dh    ; added 'read port' call
  315. write_port    equ    8Eh    ; added 'write port' call
  316. setxon        equ    8Fh    ; added 'set xon/xoff mode' call
  317. enable_ints    equ    90h    ; added 'reset ier' call
  318. default_port    equ    0    ; default to COM1: when no parameters supplied
  319. MSCOUNT        equ    500    ; we want timer to be ~ 500 ms (for BRK signl)
  320. MSSIZE        equ    70    ; MSSIZE should be set to produce 1 ms loop.
  321. TIMEOUTCNT    equ    65500    ; # of loops before giving